/**
 * Class: PRectFill
 *
 * Purpose: 
 *
 * Created: Jan 21, 2010 @ 10:50:41 AM
 * @author Ken Scott
 */
package org.openfantasia.ui;

public class POval extends PComponent {

	public POval() {
		setColor(BORDER, PColor.WHITE);
		setColor(FILL, PColor.BLACK);
	}


	public POval(float x, float y, float width, float height) {
		super(x, y, width, height, false);
	}


	public POval(float x, float y, float width, float height, boolean clickThrough) {
		super( x, y, width, height, clickThrough);
	}


	public POval(float x, float y, float width, float height, PColor border, PColor fill) {
		super(x, y, width, height, false);
		setColor(BORDER, border);
		setColor(FILL, fill);
	}


	public POval(float x, float y, float width, float height, boolean clickThrough, PColor border, PColor fill) {
		super( x, y, width, height, clickThrough);
		setColor(BORDER, border);
		setColor(FILL, fill);
	}


	public void draw() {
		PColor cFill = getColor(FILL);
		if (cFill == null) {
			noFill();
		}
		else {
			fill(cFill);
		}

		PColor cBorder = getColor(BORDER);
		if (cBorder == null) {
			noStroke();
		}
		else {
			stroke(cBorder);
		}

		ellipse(getGlobalX(), getGlobalY(), getWidth() - 1, getHeight() - 1);
	}
}